/**
  ******************************************************************************
  * @文件名称 : diso_info.c
  * @摘要 : 
  * @创建日期 : Aug 20, 2024
  * @创建者：Edward
  ******************************************************************************
  * @使用说明
  *
  *  
  ******************************************************************************
  */

/* 声明包含头文件 -----------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include "lvgl.h"
#include "../Inc/data_public.h"
/* 声明私有类型定义----------------------------------------------------------*/

/* 声明私有常量 -------------------------------------------------------------*/

/* 声明私有宏定义 -----------------------------------------------------------*/
/*
 * 信息列表显示方案
 */
#define LABEL_STRING_PLAN1		0
/* 第一版方案：每行信息创建一个容器，再在容器中创建5个label。
 *    优点：每一个label的属性可以单独设置，如：设置不同的字号等。
 *    缺点：占用过多堆空间，信息数量增加后导致堆溢出。 */

#define LABEL_STRING_PLAN2		0
/* 第二版方案：每行信息创建一个容器，再在容器中创建1个label，label中进行5个数据的拼接。
 *    优点：大大减少了堆空间的使用。
 *    缺点：数据拼接后不便于位置对齐，且需要等宽字体。 */

#define LABEL_STRING_PLAN3		1
/* 第三版方案：使用轻量级控件“表格”实现。
 *    优点：大大减少了堆空间的使用。
 *    缺点：表格间距、行高、长文本显示等性能欠佳。 */

/* 声明私有变量 -------------------------------------------------------------*/
static lv_style_t style_label_tile;/* 信息列表标签的风格 */
static lv_style_t style_list;/* 信息列表容器的风格 */
static lv_timer_t * timer_refresh_infoScreen;
static lv_obj_t * cont_info;/* 信息容器 */
static lv_obj_t * cont_btn;/* 按键容器 */
static lv_obj_t * tileview;/* 平铺视图 */
static lv_obj_t * tile_extantInfo;/* 平铺实时信息页面 */
static lv_obj_t * tile_historyInfo;/* 平铺历史信息页面 */
static lv_obj_t * list_extantInfo;/* 实时信息列表容器 */
static lv_obj_t * list_historyInfo;/* 历史信息列表容器 */
//static lv_obj_t * btn_toggleInfo;/* 切换信息按键 */
static lv_obj_t * btn_extantInfo;/* 切换信息按键 */
static lv_obj_t * btn_historyInfo;/* 切换信息按键 */
//static lv_obj_t * label_toggleInfo;/* 切换信息标签 */
static lv_obj_t * label_soundOnOff;/* 声音开关标签 */

uint8_t soundState = 1;/* 声音状态 */
uint16_t moreExtantInfo_id = 0;
uint16_t moreHistoryInfo_id = 0;
static uint8_t refresh_infoScreen_flag = 0;/* 刷新信息显示标志为 */

/* 信息列表，添加 */
//__attribute__((section (".ccmram")))
info_t nodeLib[INFO_GROUP_QTY * 16] = {
		{ 1, {0}, 0, 0, 1},{ 2, {0}, 0, 0, 0},{ 3, {0}, 0, 0, 1},{ 4, {0}, 0, 0, 1},{ 5, {0}, 0, 0, 0},
		{ 6, {0}, 0, 0, 1},{ 7, {0}, 0, 0, 1},{ 8, {0}, 0, 0, 1},{ 9, {0}, 0, 0, 0},{10, {0}, 0, 0, 0},
		{11, {0}, 0, 0, 1},{12, {0}, 0, 0, 0},{13, {0}, 0, 0, 0},{14, {0}, 0, 0, 1},{15, {0}, 0, 0, 1},
		{16, {0}, 0, 0, 0},{17, {0}, 0, 0, 1},{18, {0}, 0, 0, 0},{19, {0}, 0, 0, 1},{20, {0}, 0, 0, 1},
		{21, {0}, 0, 0, 0},{22, {0}, 0, 0, 1},{23, {0}, 0, 0, 0},{24, {0}, 0, 0, 1},{25, {0}, 0, 0, 1},
		{26, {0}, 0, 0, 0},{27, {0}, 0, 0, 1},{28, {0}, 0, 0, 1},{29, {0}, 0, 0, 0},{30, {0}, 0, 0, 0},
		{31, {0}, 0, 0, 0},{32, {0}, 0, 0, 1},{33, {0}, 0, 0, 0},{34, {0}, 0, 0, 1},{35, {0}, 0, 0, 1},
		{36, {0}, 0, 0, 1},{37, {0}, 0, 0, 1},{38, {0}, 0, 0, 1},{39, {0}, 0, 0, 1},{40, {0}, 0, 0, 1},
		{41, {0}, 0, 0, 2},{42, {0}, 0, 0, 2},{43, {0}, 0, 0, 1},{44, {0}, 0, 0, 1},{45, {0}, 0, 0, 2},
		{46, {0}, 0, 0, 1},{47, {0}, 0, 0, 2},{48, {0}, 0, 0, 1},{49, {0}, 0, 0, 0},{50, {0}, 0, 0, 1},
		{51, {0}, 0, 0, 1},{52, {0}, 0, 0, 1},{53, {0}, 0, 0, 1},{54, {0}, 0, 0, 0},{55, {0}, 0, 0, 1},
		{56, {0}, 0, 0, 1},{57, {0}, 0, 0, 1},{58, {0}, 0, 0, 1},{59, {0}, 0, 0, 1},{60, {0}, 0, 0, 1},
		{61, {0}, 0, 0, 1},{62, {0}, 0, 0, 1},{63, {0}, 0, 0, 1},{64, {0}, 0, 0, 1},{65, {0}, 0, 0, 1},
		{66, {0}, 0, 0, 1},{67, {0}, 0, 0, 1},{68, {0}, 0, 0, 1},{69, {0}, 0, 0, 1},{70, {0}, 0, 0, 1},
		{71, {0}, 0, 0, 1},{72, {0}, 0, 0, 1},{73, {0}, 0, 0, 1},{74, {0}, 0, 0, 1},{75, {0}, 0, 0, 0},
		{76, {0}, 0, 0, 0},{77, {0}, 0, 0, 0},{78, {0}, 0, 0, 1},{79, {0}, 0, 0, 0},{80, {0}, 0, 0, 1},
		{81, {0}, 0, 0, 0},{82, {0}, 0, 0, 0},{83, {0}, 0, 0, 0},{84, {0}, 0, 0, 0},{85, {0}, 0, 0, 0},
		{86, {0}, 0, 0, 0},{87, {0}, 0, 0, 0},{88, {0}, 0, 0, 0},{89, {0}, 0, 0, 0},{90, {0}, 0, 0, 0},
		{91, {0}, 0, 0, 0},{92, {0}, 0, 0, 0},{93, {0}, 0, 0, 0},{94, {0}, 0, 0, 0},{95, {0}, 0, 0, 0},
		{96, {0}, 0, 0, 0}
};

/* 信息类型多语种文本 */
const char * _infoType[3][3] = {
		{
			"警告",
			"故障",
			"保养",
		},
		{
			"warm",
			"fault",
			"maintenance",
		}

};
/* 信息内容多语种文本 */
const char * _infoText[3][INFO_GROUP_QTY * 16] = {
		{
			"",/*ID为0时占位用*/
			/* 报警组一 */
			"低液位故障",
			"低液位报警",
			"液位开关异常",
			"蒸发压力超下限故障",
			"高液位报警",
			"",
			"超用户保护温度上限异常",
			"超用户保护温度下限异常",
			"超用户报警温度上限异常",
			"超用户报警温度下限异常",
			"",
			"",
			"",
			"",
			"出液压力传感器异常",
			"出液压力大于阈值报警",
			/* 报警组二 */
			"",
			"出液压力小于阈值报警",
			"",
			"回液压力传感器异常",
			"",
			"",
			"",
			"",
			"流量传感器异常",
			"低流量报警",
			"低流量故障",
			"水质传感器异常",
			"水质异常报警",
			"",
			"",
			"温度传感器异常",
			/* 报警组三 */
			"制冷系统平衡压力较低",
			"通讯异常报警",
			"制冷回路压力故障或高压故障",
			"制冷回路低压故障",
			"",
			"",
			"水泵通讯异常1",
			"",
			"压缩机维护报警1",
			"压缩机维护报警2",
			"内循环低流量开关异常",
			"出液流量开关异常",
			"水泵维护报警1",
			"冷凝压力超上限故障",
			"过滤器维护报警",
			"内循环低流量故障",
			/* 报警组四 */
			"冷却水低流量报警",
			"温度传感器异常2",
			"急停故障",
			"外部保护故障1",
			"外部保护故障2",
			"高液位报警",
			"温度传感器3异常",
			"超工厂保护温度上限异常",
			"超工厂保护温度下限异常",
			"制冷回路高压传感器异常",
			"制冷回路低压传感器异常",
			"制冷回路高低压开关异常-1",
			"制冷回路高低压报警-1",
			"制冷回路高低压开关异常-2",
			"制冷回路高低压报警-2",
			"低流量故障",
			/* 报警组五 */
			"冷凝温度传感器异常",
			"蒸发温度传感器异常",
			"出气温度传感器异常",
			"制冷回路高压传感器异常",
			"制冷回路低压传感器异常",
			"",
			"",
			"",
			"",
			"",
			"超蒸发温度上限报警",
			"超蒸发温度下限报警",
			"EEV驱动板通讯异常",
			"",
			"超出气温度上限报警",
			"冷凝压力高压故障",
			/* 报警组六 */
			"声光驱动通讯报警",
			"",			"",			"",			"",			"",			"",			"",
			"",			"",			"",			"",			"",			"",			"",
		},
		{
			"",/*ID为0时占位用*/
			/* 报警组一 */
			"Low level fault",
			"Low level alarm",
			"Level switch abnormal",
			"EvaPress exceeds the lower",
			"High level alarm",
			"",
			"Exceed user upper pro temp",
			"Exceed user lowest pro temp",
			"Exceed user upper pro temp",
			"Exceed user lowest pro temp",
			"",
			"",
			"",
			"",
			"OutletPressure sensor abnormal",
			"Over press upper alarm Press is greater than the threshold;",
			/* 报警组二 */
			"",
			"Over press lowest alarm Press is less than the threshold;",
			"",
			"Ret Pressure sensor abnormal",
			"",
			"",
			"",
			"",
			"Flow sensor abnormal",
			"Low flow alarm",
			"Low flow faulty",
			"Water quality sensor abnormal",
			"Water quality alarm abnormal",
			"",
			"",
			"Temp sensor abnormal",
			/* 报警组三 */
			"The refrigeration systeam balance pressure is low,",
			"Commu abnormal alarm",
			"Ref press or high press failure",
			"Ref low press failure",
			"",
			"",
			"Pump commu abnormal 1",
			"",
			"Comp maintenance alarm 1",
			"Comp maintenance alarm 2",
			"In flow switch abnormal",
			"Flow switch abnormal",
			"Pump maintenance alarm 1",
			"ConPress exceeds the upper",
			"Filter maintenance alarm 1",
			"In-Low flow alarm",
			/* 报警组四 */
			"Temp sensor abnormal",
			"Temp sensor abnormal 2",
			"Emergency stop failure",
			"External Protection Fault 1",
			"External Protection Fault 2",
			"High level alarm",
			"Temp sensor abnormal 3",
			"Exceed device upper pro temp",
			"Exceed device lowest pro temp",
			"Ref high press sensor abnormal",
			"Ref low press sensor abnormal",
			"Ref press sw abnormal-1",
			"Ref low or high press alarm-1",
			"Ref press sw abnormal-2",
			"Ref low or high press alarm-2",
			"Low flow faulty",
			/* 报警组五 */
			"ConTemp sensor abnormal",
			"EvaTemp sensor abnormal",
			"OutTemp sensor abnormal",
			"Ref high press sensor abnormal",
			"Ref low press sensor abnormal",
			"",
			"",
			"",
			"",
			"",
			"Over EvaTemp upper limit alarm",
			"Over EvaTemp lowest limit alarm",
			"EEV driver board Com abnormality",
			"",
			"Over Out Temp upper limit alarm",
			"High press fault of Conpress",
			/* 报警组六 */
			"Sound and light drive communication alarm",
			"",			"",			"",			"",			"",			"",			"",
			"",			"",			"",			"",			"",			"",			"",
		}
};
/* 更多信息多语种文本 */
const char * _infoMore[3][INFO_GROUP_QTY * 16] = {
		{
			"请先选择需要了解的信息，再点击此按键。",/*ID为0时占位用*/
			/* 报警组一 */
			"循环液位较低;请及时补充循环液至正常液位。",
			"循环液位较低;请及时补充循环液至正常液位。",
			"液位开关回路出现短路或断开;请与供应商联系。",
			"蒸发压力低于压力下限，请与供应商联系。",
			"循环液位较高;请及时调整循环液至正常液位。",
			"",
			"出液实测温度大于报警温度上限;请检查环境温度、热负荷是否满足规范;请检查温度上限设置是否合理。",
			"出液实测温度小于报警温度下限;请检查环境温度的影响;请检查温度下限设置是否合理。",
			"出液实测温度大于报警温度上限;请检查环境温度、热负荷是否满足规范;请检查温度上限设置是否合理。",
			"出液实测温度小于报警温度下限;请检查环境温度的影响;请检查温度下限设置是否合理。",
			"",
			"",
			"",
			"",
			"出液压力传感器回路出现短路或断开;请与供应商联系。",
			"实测出液压力大于阈值;请检查循环管路是否过窄、外部阀门是否关闭、管道或过滤器是否堵塞。",
			/* 报警组二 */
			"",
			"实测出液压力小于阈值;请检查循环管路是否过窄、外部阀门是否关闭、管道或过滤器是否堵塞。",
			"",
			"回液压力传感器回路出现短路或断开;请与供应商联系。",
			"",
			"",
			"",
			"",
			"流量传感器回路出现短路或断开;请与供应商联系。",
			"实测流量小于阈值;请检查循环管路是否过窄、外部阀门是否关闭、管道或过滤器是否堵塞。",
			"实测流量小于阈值;请检查循环管路是否过窄、外部阀门是否关闭、管道或过滤器是否堵塞。",
			"水质传感器异常;请与供应商联系。",
			"水质数值异常;请检查循环液。",
			"",
			"",
			"温度传感器回路出现短路或断开;请与供应商联系。",
			/* 报警组三 */
			"请与供应商联系。",
			"没有收到主机的通讯信息;尝试重新发送通讯信息。",
			"制冷回路压力异常(或高压侧压力异常);请与供应商联系。",
			"制冷回路低压侧压力开关异常或压力异常;请与供应商联系。",
			"",
			"",
			"主控制器与水泵控制器通讯出现异常",
			"",
			"压缩机维护计时达到提示值;请与供应商联系，对压缩机进行维护处理。",
			"压缩机维护计时达到提示值;请与供应商联系，对压缩机进行维护处理。",
			"流量开关回路可能出现短路;请与供应商联系。",
			"流量开关回路可能出现短路;请与供应商联系。",
			"水泵维护计时达到提示值;请与供应商联系，对水泵进行维护处理。",
			"冷凝压力高于压力上限，请与供应商联系。",
			"过滤器维护计时达到提示值;请对过滤器进行维护处理。",
			"实测流量小于阈值;请检查循环管路是否过窄、外部阀门是否关闭、管道或过滤器是否堵塞。",
			/* 报警组四 */
			"冷却水流量较低，请检查冷却水回路是否通畅有流量。",
			"辅助温度传感器回路出现短路或断开;请检查辅助温度传感器连接是否正常。",
			"急停开关被按下;请检查无异常后，恢复急停开关。",
			"外部保护开关1触发;请检查外部保护情况。",
			"外部保护开关2触发;请检查外部保护情况。",
			"循环液位较高;请及时调整循环液至正常液位。",
			"温度传感器回路出现短路或断开;请与供应商联系。",
			"出液温度大于安全范围;请检查环境温度、热负荷、冷冻液流量是否满足规范。",
			"出液实测温度小于安全温度下限;请检查环境温度的影响。",
			"制冷回路高压传感器异常;请与供应商联系。",
			"制冷回路低压传感器异常;请与供应商联系。",
			"制冷回路1高低压检测开关异常;请与供应商联系。",
			"制冷回路1压力异常;请与供应商联系。",
			"制冷回路2高低压检测开关异常;请与供应商联系。",
			"制冷回路2压力异常;请与供应商联系。",
			"实测流量小于阈值;请检查循环管路是否过窄、外部阀门是否关闭、管道或过滤器是否堵塞。",
			/* 报警组五 */
			"冷凝温度传感器回路出现短路或断开;请与供应商联系。",
			"蒸发温度传感器回路出现短路或断开;请与供应商联系。",
			"出气温度传感器回路出现短路或断开;请与供应商联系。",
			"制冷回路高压传感器异常;请与供应商联系。",
			"制冷回路低压传感器异常;请与供应商联系。",
			"",
			"",
			"",
			"",
			"",
			"蒸发实测温度大于报警温度上限;请与供应商联系。",
			"蒸发实测温度小于报警温度上限;请与供应商联系。",
			"与电子膨胀阀驱动板通讯异常;请与供应商联系。",
			"",
			"压缩机出气实测温度大于报警温度上限;请与供应商联系。",
			"冷凝压力高于压力上限，请与供应商联系。",
			/* 报警组六 */
			"与声光驱动板通讯异常;请与供应商联系。",
			"",			"",			"",			"",			"",			"",			"",
			"",			"",			"",			"",			"",			"",			"",
		},
		{
			"Please select the information you want to know and then click this button.",/* 报警组一 */
			"Circulation level low, need to fill till normal level.",
			"Circulation level low, need to fill till normal level.",
			"The level switch circuit isshort-circuited or disconnected; Please contact supplier.",
			"The evaporation pressure is lower than the lower limit，Please contact your supplier. ",
			"Circulation level high, need to adjust to normal level.",
			"",
			"Outlet temp is higher than the upper alarm limit. Check the ambient temp and heat load;"
			"Or check whether the tempe upper limit setting is reasonable.",
			"Outlet temp is lower than the lowest alarm limit. Check the ambient temp; "
			"Or check whether the temp lowest setting is reasonable.",
			"Outlet temp is higher than the upper alarm limit. Check the ambient temp and"
			"heat load;Or check whether the tempe upper limit setting is reasonable.",
			"Outlet temp is lower than the lowest alarm limit. Check the ambient temp;"
			"Or check whether the temp lowest setting is reasonable.",
			"",
			"",
			"",
			"",
			"The OutletPressure sensor circuit isshort-circuited or disconnected;"
			"Please contact supplier.",
			"Check whether the circulation line is too narrow, the external valve Is it closed, "
			"is the pipeor filter clogged.",
			/* 报警组二 */
			"",
			"Check whether the circulation line is too narrow, the external "
			"valve Is it closed, is the pipeor filter clogged.",
			"",
			"The liquid return Pressure sensor circuit isshort-circuited or"
			"disconnected; Please contact supplier.",
			"",
			"",
			"",
			"",
			"The flow sensor circuit is short-circuited or disconnected; "
			"Please contact supplier.",
			"Flow is less than the threshold; Check whether the circulation"
			"line is too narrow, the external valve Is it closed, is the pipe or filter clogged.",
			"Flow is less than the threshold; Check whether the circulation "
			"line is too narrow, the external valve Is it closed, is the pipe or filter clogged.",
			"The water quality sensor is abnormal; Please contact your supplier. ",
			"The water quality value is abnormal; Please check the circulating fluid. ",
			"",
			"",
			"The temp sensor circuit is short-circuited or disconnected;"
			"Please contact supplier.",
			/* 报警组三 */
			"Please contact supplier.",
			"Communication info from host is not well received; Try resending "
			"the communication message.",
			"Press of the refrigeration circuit abnormal (or the press. of the high"
			"press side is abnormal);Please contact your supplier.",
			"Pressure switch or pressure abnormal at the low-pressure side of the"
			"refrigeration circuit;Please contact supplier.",
			"",
			"",
			"The communication between the main controller and the pump controller"
			"is abnormal",
			"",
			"Comp need to maintenance;Please contact the supplier.",
			"Comp need to maintenance;Please contact the supplier.",
			"The Internal circulationlow flow switch circuit is short-circuited"
			"or disconnected; Please contact supplier.",
			"The low flow switch circuit is short-circuited or disconnected;"
			"Please contact supplier.",
			"Pump need to maintenance; Please contact the supplier.",
			"The condensation pressure is higher than the upper limit，Please contact your supplier.",
			"Filter need to maintenance; Please contact the supplier.",
			"Flow is less than the threshold; Check whether the circulation"
			"line is too narrow, the external valve Is it closed, is the pipeor filter clogged.",
			/* 报警组四 */
			"The temp sensor circuit is short-circuited or disconnected; Please contact supplier.",
			"Secondary temp sensor circuit is short-circuited or disconnected;"
			"Check the secondary temp sensor connection is normal.",
			"The emergency stop switch is pressed; Restore the emergency stop switch"
			"only if abnormal.",
			"External protection switch 1 triggers; Please check the external protection. ",
			"External protection switch 2 triggers; Please check the external protection.",
			"Circulation level high, need to adjust to normal level.",
			"The temp sensor circuit is short-circuited or disconnected; Please contact supplier.",
			"Outlet temp is higher than the safe range;Please check"
			"the ambient temp, heat load, and flow of circulating fluid.",
			"Outlet temp is lower than the safe range; Please check the ambient temp.",
			"The high pressure sensor of the refrigeration circuit abnormal; Please contact supplier. ",
			"The low pressure sensor of therefrigeration circuit abnormal; Please contact your supplier. ",
			"The high or low pressure switch of the refrigeration circuit 1abnormal;"
			"Please contact supplier. ",
			"Press of the refrigeration circuit 1 abnormal; Please contact your supplier.",
			"The high or low pressure switch of the refrigeration circuit 2 abnormal;"
			"Please contact supplier. ",
			"Press of the refrigeration circuit 2abnormal; Please contact your supplier.",
			"Flow is less than the threshold; Check whether the circulation"
			"line is too narrow, the external valve Is it closed, is the pipeor filter clogged.",
			/* 报警组五 */
			"The condensing temp sensor circuit is short-circuited or disconnected;"
			"Please contact supplier.",
			"The evaporating temp sensor circuit is short-circuited or disconnected;"
			"Please contact supplier.",
			"The outlet temp sensor circuit is short-circuited or disconnected;"
			"Please contact supplier.",
			"The high pressure sensor of the refrigeration circuit abnormal; Please contact supplier. ",
			"The low pressure sensor of the refrigeration circuit abnormal;"
			"Please contact your supplier. ",
			"",
			"",
			"",
			"",
			"",
			"Outlet evaporation temp is higher than the upper alarm limit. Please contact supplier.",
			"Outlet evaporation temp is lower than the lowest alarm limit. Please contact supplier.",
			"Abnormal communication with the electronic expansion valve driver"
			"board;Please contact the supplier.",
			"",
			"Compressor outlet temp is higher than the upper alarm limit. Please contact supplier.",
			"The condensation pressure is higher than the upper limit，Please contact your supplier. ",
			/* 报警组六 */
			"Abnormal communication with the acousto-optic driver board;"
			"Please contact the supplier.",
			"",			"",			"",			"",			"",			"",			"",
			"",			"",			"",			"",			"",			"",			"",
		}
};

/* 声明私有函数 -------------------------------------------------------------*/
/**
	* 函 数 名： 
	* 功能说明： 
	* 入口参数： 
	* 返 回 值： 
	*/

/* 切换信息界面按键的回调函数 */
static void btn_toggleInfo_cb(lv_event_t * e)
{
	/* 根据当前界面内容切换页面 */
	lv_obj_t* target = lv_event_get_target(e);
	if (target == btn_extantInfo)
	{
		lv_obj_set_tile(tileview, tile_extantInfo, LV_ANIM_ON);
		lv_obj_add_state(btn_extantInfo, LV_STATE_CHECKED);
		lv_obj_clear_state(btn_historyInfo, LV_STATE_CHECKED);
	}
	else
	{
		lv_obj_set_tile(tileview, tile_historyInfo, LV_ANIM_ON);
		lv_obj_add_state(btn_historyInfo, LV_STATE_CHECKED);
		lv_obj_clear_state(btn_extantInfo, LV_STATE_CHECKED);
	}
}
/* 蜂鸣器开关按键的回调函数 */
static void btn_soundOnOff_cb(lv_event_t * e)
{
	lv_obj_t * btn = lv_event_get_current_target(e);
	if(lv_obj_has_flag(btn, LV_OBJ_FLAG_USER_1))
	{
		lv_label_set_text(label_soundOnOff, dispText[DA.typeLanguage].soundOn);
		lv_obj_clear_flag(btn, LV_OBJ_FLAG_USER_1);
		UP.regAddr100.Para.ES_Buzzer = 0;
	}
	else
	{
		lv_label_set_text(label_soundOnOff, dispText[DA.typeLanguage].soundOff);
		lv_obj_add_flag(btn, LV_OBJ_FLAG_USER_1);
		UP.regAddr100.Para.ES_Buzzer = 1;
	}
	send_aux(&UP.regAddr100.rState_Chiller);
}
/* 更多信息按键的回调函数 */
static void btn_moreInfo_cb(lv_event_t * e)
{
	__IO uint16_t opaID = 0;
	lv_obj_t * now_televiewv;
//	char text;
	now_televiewv = lv_tileview_get_tile_act(tileview);/* 获取当前页面 */
	/* 根据当前界面内容切换页面 */
	if(now_televiewv == tile_extantInfo)
		opaID = moreExtantInfo_id;
	else
		opaID = moreHistoryInfo_id;
	const char * btn_txts[] = {""};
	lv_obj_t * msgbox_moreInfo = lv_msgbox_create(NULL, dispText[DA.typeLanguage].moreInfo, _infoMore[DA.typeLanguage][opaID], btn_txts, true);
	lv_obj_set_size(msgbox_moreInfo, lv_pct(75), lv_pct(75));
	lv_obj_center(msgbox_moreInfo);
	lv_obj_t * title = lv_msgbox_get_title(msgbox_moreInfo);
	lv_obj_set_style_text_color(title, lv_color_hex(0x0000ff), LV_STATE_DEFAULT);

}
#if	LABEL_STRING_PLAN1 || LABEL_STRING_PLAN2
/* 信息列表按下的回调函数 */
static void cont_infoList_cb(lv_event_t * e)
{
	lv_event_code_t code = lv_event_get_code(e);
	lv_obj_t* obj = (lv_obj_t*)lv_event_get_target(e);
	lv_obj_t* parent = lv_obj_get_parent(obj);
	listNode_t * opaNode = NULL;
	if (code == LV_EVENT_CLICKED)
	{
		for (uint32_t i = 0; i < lv_obj_get_child_cnt(parent); i++)
		{
			lv_obj_t* child = lv_obj_get_child(parent, i);
			if (child == obj)
			{
				lv_obj_add_state(child, LV_STATE_CHECKED);
				if(parent == list_extantInfo)
				{
					list_findNodeBySN(&listNode_extantInfo, i, &opaNode);
					moreExtantInfo_id = (*opaNode).record.id;
				}
				else if(parent == list_historyInfo)
				{
					list_findNodeBySN(&listNode_historyInfo, i, &opaNode);
					moreHistoryInfo_id = (*opaNode).record.id;
				}
			}
			else
			{
				lv_obj_clear_state(child, LV_STATE_CHECKED);
			}
		}
	}
}
#endif
/* 信息复位按键回调 */
static void btn_resetInfo_cb(lv_event_t * e)
{
	lv_event_code_t code = lv_event_get_code(e);
	if (code == LV_EVENT_CLICKED)
	{
		UP.regAddr100.Para.AlarmReset = 1;
		send_aux(&UP.regAddr100.rState_Chiller);
	}
}
static void extant_list_draw_event_cb(lv_event_t * e)
{
    lv_obj_t * obj = lv_event_get_target(e);
    lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e);
    listNode_t * opaNode = NULL;

    static uint8_t ctrl_lastRow = 255;
    /*If the cells are drawn...*/
    if(dsc->part == LV_PART_ITEMS) {
        uint32_t row = dsc->id /  lv_table_get_col_cnt(obj);
        uint32_t col = dsc->id - row * lv_table_get_col_cnt(obj);

        bool chk = lv_table_has_cell_ctrl(obj, row, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
		if(chk)
		{
			if(ctrl_lastRow != row)
			{
				list_findNodeBySN(&listNode_extantInfo, row, &opaNode);
				moreExtantInfo_id = (*opaNode).record.id;
				ctrl_lastRow = row;
			}
			dsc->rect_dsc->bg_color = lv_color_hex(0x1d4b78);
		}
		else
		{
			dsc->rect_dsc->bg_color = lv_color_hex(0xFFFFFF);

		}

//        if(col == 1) {
//            dsc->label_dsc->font = &lv_font_montserrat_20;
//            dsc->label_dsc->ofs_y = 28;
//        }

        if(col == 1)
        {
        	dsc->label_dsc->line_space = -12;
        }
        else
        {
        	dsc->label_dsc->align = LV_TEXT_ALIGN_CENTER;
        }
    }
}
static void history_list_draw_event_cb(lv_event_t * e)
{
    lv_obj_t * obj = lv_event_get_target(e);
    lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e);
    listNode_t * opaNode = NULL;
    static uint8_t ctrl_lastRow = 255;
    /*If the cells are drawn...*/
    if(dsc->part == LV_PART_ITEMS) {
        uint32_t row = dsc->id /  lv_table_get_col_cnt(obj);
        uint32_t col = dsc->id - row * lv_table_get_col_cnt(obj);

        bool chk = lv_table_has_cell_ctrl(obj, row, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
		if(chk)
		{
			if(ctrl_lastRow != row)
			{
				list_findNodeBySN(&listNode_historyInfo, row, &opaNode);
				moreHistoryInfo_id = (*opaNode).record.id;
				ctrl_lastRow = row;
			}
			dsc->rect_dsc->bg_color = lv_color_hex(0x1d4b78);
		}
		else
		{
			dsc->rect_dsc->bg_color = lv_color_hex(0xFFFFFF);
		}

		list_findNodeBySN(&listNode_historyInfo, row, &opaNode);
		if(opaNode->record.duration == 0)
			dsc->label_dsc->color = lv_color_hex(COLOUR_WIIP_ORANGE);

//        if(col == 1) {
//            dsc->label_dsc->font = &lv_font_montserrat_20;
//            dsc->label_dsc->ofs_y = 28;
//        }

        if(col == 1)
		{
			dsc->label_dsc->line_space = -12;
		}
		else
		{
			dsc->label_dsc->align = LV_TEXT_ALIGN_CENTER;
		}

    }
}
static void extant_list_change_event_cb(lv_event_t * e)
{
    lv_obj_t * obj = lv_event_get_target(e);
    uint16_t col;
    uint16_t row;
    lv_table_get_selected_cell(obj, &row, &col);
    for(uint16_t row_cnt = 0; row_cnt < lv_table_get_row_cnt(obj); row_cnt++)
    {
    	if(row == row_cnt)
		{
    		lv_table_add_cell_ctrl(obj, row_cnt, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
		}
		else
		{
			lv_table_clear_cell_ctrl(obj, row_cnt, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
		}
    }

}
static void history_list_change_event_cb(lv_event_t * e)
{
    lv_obj_t * obj = lv_event_get_target(e);
    uint16_t col;
    uint16_t row;
    lv_table_get_selected_cell(obj, &row, &col);
    for(uint16_t row_cnt = 0; row_cnt < lv_table_get_row_cnt(obj); row_cnt++)
    {
    	if(row == row_cnt)
		{
    		lv_table_add_cell_ctrl(obj, row_cnt, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
		}
		else
		{
			lv_table_clear_cell_ctrl(obj, row_cnt, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
		}
    }
}
/**
 * @brief  刷新并处理信息界面
 * @param  lv_anim_tmr lvge定时器描述结构体
 * @retval 无
 */
static void refresh_infoScreen(struct _lv_timer_t * lv_anim_tmr)
{

	UNUSED(lv_anim_tmr);/* 未使用回调函数的传参，进行说明，去除编译报警 */
#if	LABEL_STRING_PLAN1 || LABEL_STRING_PLAN2
	lv_obj_t * cont_infoList;/* 信息列表容器 */
	lv_obj_t* lab;/* 信息列表容器中的标签 */
#endif
#if	LABEL_STRING_PLAN2
	static char labelStr[100] = {0};/* label上文本字符串，用static减少栈空间的使用 */
#endif
#if	LABEL_STRING_PLAN3
	uint8_t row_cnt = 0;
#endif
	listNode_t * opaNode = listNode_extantInfo;/* 需要操作的信息节点 */
//	static lv_obj_t * last_televiewv = NULL;
//
//	/* 1.刷新切换按键上的label */
//	lv_obj_t * now_televiewv = lv_tileview_get_tile_act(tileview);/* 获取当前显示的页面，返回为实时页面或者历史页面 */
//	if(now_televiewv != last_televiewv)/* 如果界面发生了变化 */
//	{
//		if(now_televiewv == tile_extantInfo)/* 目前显示的是实时信息 */
//		{
//			lv_label_set_text(label_toggleInfo, dispText[DA.typeLanguage].extantInfo);
//		}
//		else/* 目前显示的是历史信息 */
//		{
//			lv_label_set_text(label_toggleInfo, dispText[DA.typeLanguage].historyInfo);
//		}
//	}

	/* 2.刷新界面上的信息列表 */
	if(refresh_infoScreen_flag == 0)/* 判断刷新标志位，如果不需要刷新则退出 */
		return;
	/* 需要刷新则清除刷新标志位，删除之前的信息列表容器，重新创建列表内容 */
	refresh_infoScreen_flag = 0;/* 清空标志为 */

#if	LABEL_STRING_PLAN1 || LABEL_STRING_PLAN2
	lv_obj_del(list_extantInfo);/* 删除之前的信息列表容器 */
	list_extantInfo = lv_list_create(tile_extantInfo);/* 在实时信息页面创建实时信息列表 */
#endif
#if	LABEL_STRING_PLAN3
	lv_obj_del(list_extantInfo);/* 删除之前的信息列表容器 */
	list_extantInfo = lv_table_create(tile_extantInfo);
	lv_obj_set_style_pad_ver(list_extantInfo, 0, LV_PART_ITEMS);
	lv_obj_set_style_pad_row(list_extantInfo, 0, LV_PART_ITEMS);
	lv_obj_set_style_pad_top(list_extantInfo, -4, LV_PART_ITEMS);
	lv_obj_set_style_pad_bottom(list_extantInfo, -4, LV_PART_ITEMS);
	lv_obj_set_style_pad_left(list_extantInfo, 1, LV_PART_ITEMS);
	lv_obj_set_style_pad_right(list_extantInfo, 1, LV_PART_ITEMS);
	lv_obj_set_style_bg_color(list_extantInfo, lv_color_hex(0xFFFFFF), LV_PART_ITEMS);
	lv_obj_set_style_outline_width(list_extantInfo, 1, LV_PART_ITEMS);
	lv_obj_set_style_outline_color(list_extantInfo, lv_palette_main(LV_PALETTE_GREY), LV_PART_ITEMS);
	lv_table_set_col_cnt(list_extantInfo, 3);
	lv_table_set_col_width(list_extantInfo, 0, 70);
	lv_table_set_col_width(list_extantInfo, 1, 165);
	lv_table_set_col_width(list_extantInfo, 2, 325);
//	lv_table_set_col_width(list_extantInfo, 3, 110);
	lv_obj_add_event_cb(list_extantInfo, extant_list_draw_event_cb, LV_EVENT_DRAW_PART_BEGIN, NULL);
	lv_obj_add_event_cb(list_extantInfo, extant_list_change_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
#endif
	lv_obj_set_size(list_extantInfo, lv_pct(100), lv_pct(85));
	lv_obj_align(list_extantInfo, LV_ALIGN_BOTTOM_MID, 0, 0);
	while(opaNode)
	{
#if LABEL_STRING_PLAN1
		cont_infoList = lv_obj_create(list_extantInfo);/* 在实时信息页面中创建实时信息表头容器 */
		lv_obj_set_size(cont_infoList, lv_pct(100), lv_pct(15));
		lv_obj_set_style_radius(cont_infoList, 0, LV_STATE_DEFAULT);/* 圆角 */
		lv_obj_set_style_pad_top(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_bottom(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_left(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_right(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_color(cont_infoList, lv_palette_main(LV_PALETTE_GREY), LV_STATE_DEFAULT);
		lv_obj_set_style_border_width(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_side(cont_infoList, LV_BORDER_SIDE_BOTTOM, LV_STATE_DEFAULT);
		lv_obj_set_style_bg_color(cont_infoList, lv_color_hex(0x009944), LV_STATE_CHECKED);
		lv_obj_add_event_cb(cont_infoList, cont_infoList_cb, LV_EVENT_CLICKED, NULL);/* 信息列表按下的回调函数 */

		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%d", opaNode->record.id);
		lv_obj_set_size(lab, lv_pct(10), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, 0, 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%s", _infoText[DA.typeLanguage][opaNode->record.id]);
		lv_obj_set_size(lab, lv_pct(50), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, lv_pct(10), 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%02d%02d%02d %02d:%02d:%02d",
				opaNode->record.ariseTime.year,
				opaNode->record.ariseTime.month,
				opaNode->record.ariseTime.day,
				opaNode->record.ariseTime.hour,
				opaNode->record.ariseTime.min,
				opaNode->record.ariseTime.sec);
		lv_obj_set_size(lab, lv_pct(25), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, lv_pct(60), 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_top(lab, 5, LV_STATE_DEFAULT);/* 顶部内填充 */
		lv_obj_set_style_text_font(lab, &lv_font_montserrat_20, LV_STATE_DEFAULT);
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%s", _infoType[DA.typeLanguage][opaNode->record.type]);
		lv_obj_set_size(lab, lv_pct(15), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, lv_pct(85), 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);

#elif LABEL_STRING_PLAN2
		cont_infoList = lv_obj_create(list_extantInfo);/* 在实时信息页面中创建实时信息表头容器 */
		lv_obj_set_size(cont_infoList, lv_pct(100), lv_pct(15));
		lv_obj_set_style_radius(cont_infoList, 0, LV_STATE_DEFAULT);/* 圆角 */
		lv_obj_set_style_pad_top(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_bottom(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_left(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_right(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_color(cont_infoList, lv_palette_main(LV_PALETTE_GREY), LV_STATE_DEFAULT);
		lv_obj_set_style_border_width(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_side(cont_infoList, LV_BORDER_SIDE_BOTTOM, LV_STATE_DEFAULT);
		lv_obj_set_style_bg_color(cont_infoList, lv_color_hex(0x009944), LV_STATE_CHECKED);
		lv_obj_add_event_cb(cont_infoList, cont_infoList_cb, LV_EVENT_CLICKED, NULL);/* 信息列表按下的回调函数 */

		static char labelStr[100] = {0};/* 减少栈空间的使用 */
		sprintf(labelStr, "  %03d    %-40s   %02d%02d%02d %02d:%02d:%02d   %s",
				opaNode->record.id,
				_infoText[DA.typeLanguage][opaNode->record.id],
				opaNode->record.ariseTime.year,
				opaNode->record.ariseTime.month,
				opaNode->record.ariseTime.day,
				opaNode->record.ariseTime.hour,
				opaNode->record.ariseTime.min,
				opaNode->record.ariseTime.sec,
				_infoType[DA.typeLanguage][opaNode->record.type]);/* 左侧预留两个空格用于对齐，以下同理 */
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%s", labelStr);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
#elif LABEL_STRING_PLAN3
		lv_table_set_cell_value_fmt(list_extantInfo, row_cnt, 0, "%d", opaNode->record.id);
		if(opaNode->record.id < INFO_GROUP_QTY * 16)
			lv_table_set_cell_value_fmt(list_extantInfo, row_cnt, 2, "%s", _infoText[DA.typeLanguage][opaNode->record.id]);
		else
			return;
		lv_table_set_cell_value_fmt(list_extantInfo, row_cnt, 1, "20%02d-%02d-%02d \n%02d:%02d:%02d",
				opaNode->record.ariseTime.year,
				opaNode->record.ariseTime.month,
				opaNode->record.ariseTime.day,
				opaNode->record.ariseTime.hour,
				opaNode->record.ariseTime.min,
				opaNode->record.ariseTime.sec);
//		lv_table_set_cell_value_fmt(list_extantInfo, row_cnt, 3, "%s", _infoType[DA.typeLanguage][opaNode->record.type]);
		row_cnt++;
#endif/* 信息列表label显示方案结束 */
		opaNode = opaNode->next;
	}



#if	LABEL_STRING_PLAN1 || LABEL_STRING_PLAN2
	lv_obj_del(list_historyInfo);/* 删除之前的信息列表容器 */
	list_historyInfo = lv_list_create(tile_historyInfo);/* 在历史信息页面创建历史信息列表 */
#endif
#if	LABEL_STRING_PLAN3
	lv_obj_del(list_historyInfo);/* 删除之前的信息列表容器 */
	list_historyInfo = lv_table_create(tile_historyInfo);

	lv_obj_set_style_pad_ver(list_historyInfo, 0, LV_PART_ITEMS);
	lv_obj_set_style_pad_row(list_historyInfo, 0, LV_PART_ITEMS);
	lv_obj_set_style_pad_top(list_historyInfo, -4, LV_PART_ITEMS);
	lv_obj_set_style_pad_bottom(list_historyInfo, -4, LV_PART_ITEMS);
	lv_obj_set_style_pad_left(list_historyInfo, 1, LV_PART_ITEMS);
	lv_obj_set_style_pad_right(list_historyInfo, 1, LV_PART_ITEMS);
	lv_obj_set_style_bg_color(list_historyInfo, lv_color_hex(COLOUR_WIIP_ORANGE), LV_PART_ITEMS);
	lv_obj_set_style_outline_width(list_historyInfo, 1, LV_PART_ITEMS);
	lv_obj_set_style_outline_color(list_historyInfo, lv_palette_main(LV_PALETTE_GREY), LV_PART_ITEMS);

	lv_table_set_col_width(list_historyInfo, 0, 60);
	lv_table_set_col_width(list_historyInfo, 1, 165);
	lv_table_set_col_width(list_historyInfo, 2, 60);
	lv_table_set_col_width(list_historyInfo, 3, 280);
//	lv_table_set_col_width(list_historyInfo, 4, 110);

	lv_obj_add_event_cb(list_historyInfo, history_list_draw_event_cb, LV_EVENT_DRAW_PART_BEGIN, NULL);
	lv_obj_add_event_cb(list_historyInfo, history_list_change_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
	row_cnt = 0;
#endif
	lv_obj_set_size(list_historyInfo, lv_pct(100), lv_pct(85));
	lv_obj_align(list_historyInfo, LV_ALIGN_BOTTOM_MID, 0, 0);

	opaNode = listNode_historyInfo;
	while(opaNode)
	{
#if LABEL_STRING_PLAN1
		cont_infoList = lv_obj_create(list_historyInfo);/* 在历史信息页面中创建实时信息表头容器 */
		lv_obj_set_size(cont_infoList, lv_pct(100), lv_pct(15));
		lv_obj_set_style_radius(cont_infoList, 0, LV_STATE_DEFAULT);/* 圆角 */
		lv_obj_set_style_pad_top(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_bottom(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_left(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_right(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_color(cont_infoList, lv_palette_main(LV_PALETTE_GREY), LV_STATE_DEFAULT);
		lv_obj_set_style_border_width(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_side(cont_infoList, LV_BORDER_SIDE_BOTTOM, LV_STATE_DEFAULT);
		lv_obj_set_style_bg_color(cont_infoList, lv_color_hex(0x009944), LV_STATE_CHECKED);
		lv_obj_add_event_cb(cont_infoList, cont_infoList_cb, LV_EVENT_CLICKED, NULL);/* 信息列表按下的回调函数 */

		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%d", opaNode->record.id);
		lv_obj_set_size(lab, lv_pct(10), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, 0, 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		if(opaNode->record.duration == 0)
			lv_obj_set_style_text_color(lab, lv_color_hex(0xff0000),0);
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%s", _infoText[DA.typeLanguage][opaNode->record.id]);
		lv_obj_set_size(lab, lv_pct(40), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, lv_pct(10), 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		if(opaNode->record.duration == 0)
			lv_obj_set_style_text_color(lab, lv_color_hex(0xff0000),0);
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab,  "%02d%02d%02d %02d:%02d:%02d",
				opaNode->record.ariseTime.year,
				opaNode->record.ariseTime.month,
				opaNode->record.ariseTime.day,
				opaNode->record.ariseTime.hour,
				opaNode->record.ariseTime.min,
				opaNode->record.ariseTime.sec);
		lv_obj_set_size(lab, lv_pct(25), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, lv_pct(50), 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_top(lab, 5, LV_STATE_DEFAULT);/* 顶部内填充 */
		lv_obj_set_style_text_font(lab, &lv_font_montserrat_20, LV_STATE_DEFAULT);
		if(opaNode->record.duration == 0)
			lv_obj_set_style_text_color(lab, lv_color_hex(0xff0000),0);
		lab = lv_label_create(cont_infoList);
		if(opaNode->record.duration == 0)
			lv_label_set_text(lab, "--");
		else if(opaNode->record.duration < 60)
			lv_label_set_text_fmt(lab, "%ds", (int)opaNode->record.duration);
		else
			lv_label_set_text_fmt(lab, "%dm", (int)opaNode->record.duration / 60);
		lv_obj_set_size(lab, lv_pct(10), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, lv_pct(75), 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		if(opaNode->record.duration == 0)
			lv_obj_set_style_text_color(lab, lv_color_hex(0xff0000),0);
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%s", _infoType[DA.typeLanguage][opaNode->record.type]);
		lv_obj_set_size(lab, lv_pct(15), lv_pct(100));
		lv_obj_align(lab, LV_ALIGN_LEFT_MID, lv_pct(85), 0);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		if(opaNode->record.duration == 0)
			lv_obj_set_style_text_color(lab, lv_color_hex(0xff0000),0);
#elif LABEL_STRING_PLAN2
		cont_infoList = lv_obj_create(list_historyInfo);/* 在历史信息页面中创建实时信息表头容器 */
		lv_obj_set_size(cont_infoList, lv_pct(100), lv_pct(15));
		lv_obj_set_style_radius(cont_infoList, 0, LV_STATE_DEFAULT);/* 圆角 */
		lv_obj_set_style_pad_top(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_bottom(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_left(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_pad_right(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_color(cont_infoList, lv_palette_main(LV_PALETTE_GREY), LV_STATE_DEFAULT);
		lv_obj_set_style_border_width(cont_infoList, 1, LV_STATE_DEFAULT);
		lv_obj_set_style_border_side(cont_infoList, LV_BORDER_SIDE_BOTTOM, LV_STATE_DEFAULT);
		lv_obj_set_style_bg_color(cont_infoList, lv_color_hex(0x009944), LV_STATE_CHECKED);
		lv_obj_add_event_cb(cont_infoList, cont_infoList_cb, LV_EVENT_CLICKED, NULL);/* 信息列表按下的回调函数 */

		char durationStr[10] = {0};
		if(opaNode->record.duration == 0)
			sprintf(durationStr, "%s", "--");
		else if(opaNode->record.duration < 60)
			sprintf(durationStr, "%4ds", (int)opaNode->record.duration);
		else
			sprintf(durationStr, "%4dm", (int)(opaNode->record.duration / 60));
		sprintf(labelStr, "  %03d    %-40s   %02d%02d%02d %02d:%02d:%02d   %s   %s",
				opaNode->record.id,
				_infoText[DA.typeLanguage][opaNode->record.id],
				opaNode->record.ariseTime.year,
				opaNode->record.ariseTime.month,
				opaNode->record.ariseTime.day,
				opaNode->record.ariseTime.hour,
				opaNode->record.ariseTime.min,
				opaNode->record.ariseTime.sec,
				durationStr,
				_infoType[DA.typeLanguage][opaNode->record.type]);/* 左侧预留两个空格用于对齐，以下同理 */
		lab = lv_label_create(cont_infoList);
		lv_label_set_text_fmt(lab, "%s", labelStr);
		lv_obj_add_style(lab, &style_label_tile, LV_STATE_DEFAULT);
		if(opaNode->record.duration == 0)/* 如果持续时间为0（即正在发生），字体颜色变为红色 */
			lv_obj_set_style_text_color(lab, lv_color_hex(0xff0000),0);
#elif LABEL_STRING_PLAN3
		lv_table_set_cell_value_fmt(list_historyInfo, row_cnt, 0, "%d", opaNode->record.id);
		if(opaNode->record.id < INFO_GROUP_QTY * 16)
			lv_table_set_cell_value_fmt(list_historyInfo, row_cnt, 3, "%s", _infoText[DA.typeLanguage][opaNode->record.id]);
		else
			return;
		lv_table_set_cell_value_fmt(list_historyInfo, row_cnt, 1, "20%02d-%02d-%02d \n%02d:%02d:%02d",
				opaNode->record.ariseTime.year,
				opaNode->record.ariseTime.month,
				opaNode->record.ariseTime.day,
				opaNode->record.ariseTime.hour,
				opaNode->record.ariseTime.min,
				opaNode->record.ariseTime.sec);
		if(opaNode->record.duration == 0)
			lv_table_set_cell_value(list_historyInfo, row_cnt, 2, "--");
		else if(opaNode->record.duration < 60)
			lv_table_set_cell_value_fmt(list_historyInfo, row_cnt, 2, "%ds", (int)opaNode->record.duration);
		else
			lv_table_set_cell_value_fmt(list_historyInfo, row_cnt, 2, "%dm", (int)opaNode->record.duration / 60);

//		lv_table_set_cell_value_fmt(list_historyInfo, row_cnt, 4, "%s", _infoType[DA.typeLanguage][opaNode->record.type]);
		row_cnt++;
#endif/* 信息列表label显示方案结束 */

		opaNode = opaNode->next;
	}
}
/* 平铺视图事件回调函数 */
static void tileview_toggle_cb(lv_event_t * e)
{
	/* 获取当前界面内容页面 */
	lv_obj_t * target = lv_event_get_target(e);
	if (lv_tileview_get_tile_act(target) == tile_extantInfo)
	{
		lv_obj_add_state(btn_extantInfo, LV_STATE_CHECKED);
		lv_obj_clear_state(btn_historyInfo, LV_STATE_CHECKED);
	}
	else
	{
		lv_obj_add_state(btn_historyInfo, LV_STATE_CHECKED);
		lv_obj_clear_state(btn_extantInfo, LV_STATE_CHECKED);
	}
}
/* 创建信息容器并进行配置 */
static void createCont_info(void)
{
	cont_info = lv_obj_create(lv_scr_act());/* 在活动界面中创建信息容器 */
	/* 设置信息容器的大小、位置、颜色 */
	lv_obj_set_size(cont_info, lv_pct(76), lv_pct(82));
	lv_obj_align(cont_info, LV_ALIGN_TOP_MID, lv_pct(12), lv_pct(13));
//	lv_obj_set_style_bg_color(cont_info, lv_color_hex(0x99ccff), 0);
	lv_obj_set_style_bg_opa(cont_info, LV_OPA_TRANSP, LV_STATE_DEFAULT);
	lv_obj_set_style_border_opa(cont_info, LV_OPA_TRANSP, LV_STATE_DEFAULT);

	tileview = lv_tileview_create(cont_info); /* 在信息容器中创建平铺试图，用于切换“实时信息”与“历史信息” */
	lv_obj_set_size(tileview, lv_pct(100), lv_pct(85));
	tile_extantInfo = lv_tileview_add_tile(tileview, 0, 0, LV_DIR_RIGHT );/* 添加实时信息页面 */
	tile_historyInfo = lv_tileview_add_tile(tileview, 1, 0, LV_DIR_LEFT );/* 添加历史信息页面 */
	lv_obj_set_tile(tileview, tile_extantInfo, LV_ANIM_ON);/* 设置当前页面为实时信息页面 */
	lv_obj_align(tileview, LV_ALIGN_TOP_LEFT, 0, lv_pct(15));
	lv_obj_add_event_cb(tileview, tileview_toggle_cb, LV_EVENT_VALUE_CHANGED, NULL);

	/* 在实时信息页面创建实时信息表头 */
	lv_obj_t * cont_tileExtant;/* 实时信息表头容器 */
	cont_tileExtant = lv_obj_create(tile_extantInfo);/* 在实时信息页面中创建实时信息表头容器 */
	/* 设置实时信息表头容器的大小、位置、颜色、内部边距 */
	lv_obj_set_size(cont_tileExtant, lv_pct(100), lv_pct(15));
	lv_obj_align(cont_tileExtant, LV_ALIGN_TOP_MID, 0, 0);
//	lv_obj_set_style_bg_color(cont_tileExtant, lv_color_hex(0xffffff), 0);
	lv_obj_set_style_radius(cont_tileExtant, 0, LV_STATE_DEFAULT);/* 圆角 */
	lv_obj_set_style_pad_top(cont_tileExtant, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(cont_tileExtant, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(cont_tileExtant, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(cont_tileExtant, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_border_opa(cont_tileExtant, LV_OPA_TRANSP, LV_STATE_DEFAULT);

	lv_obj_t * label_tile1_ID = lv_label_create(cont_tileExtant);/* 列表中增加"编号"标签 */
	lv_label_set_text(label_tile1_ID, dispText[DA.typeLanguage].infoTttle_ID);
	lv_obj_set_size(label_tile1_ID, lv_pct(12), lv_pct(100));
	lv_obj_add_style(label_tile1_ID, &style_label_tile, LV_STATE_DEFAULT);

	lv_obj_t * label_tile1_time = lv_label_create(cont_tileExtant);/* 列表中增加"产生时间"标签 */
	lv_label_set_text(label_tile1_time, dispText[DA.typeLanguage].infoTttle_ariseTime);
	lv_obj_set_size(label_tile1_time, lv_pct(30), lv_pct(100));
	lv_obj_add_style(label_tile1_time, &style_label_tile, LV_STATE_DEFAULT);
	lv_obj_align_to(label_tile1_time, label_tile1_ID, LV_ALIGN_OUT_RIGHT_MID, 0, 0);

	lv_obj_t * label_tile1_text = lv_label_create(cont_tileExtant);/* 列表中增加"文本"标签 */
	lv_label_set_text(label_tile1_text, dispText[DA.typeLanguage].infoTttle_extantText);
	lv_obj_set_size(label_tile1_text, lv_pct(58), lv_pct(100));
	lv_obj_add_style(label_tile1_text, &style_label_tile, LV_STATE_DEFAULT);
	lv_obj_align_to(label_tile1_text, label_tile1_time, LV_ALIGN_OUT_RIGHT_MID, 0, 0);

//	lv_obj_t * label_tile1_type = lv_label_create(cont_tileExtant);/* 列表中增加"类型"标签 */
//	lv_label_set_text(label_tile1_type, dispText[DA.typeLanguage].infoTttle_type);
//	lv_obj_set_size(label_tile1_type, lv_pct(15), lv_pct(100));
//	lv_obj_add_style(label_tile1_type, &style_label_tile, LV_STATE_DEFAULT);
//	lv_obj_align_to(label_tile1_type, label_tile1_time, LV_ALIGN_OUT_RIGHT_MID, 0, 0);

	/* 在实时信息页面创建实时信息列表 */
	list_extantInfo = lv_list_create(tile_extantInfo);
	lv_obj_set_size(list_extantInfo, lv_pct(100), lv_pct(85));
	lv_obj_align(list_extantInfo, LV_ALIGN_BOTTOM_MID, 0, 0);
	lv_obj_add_style(list_extantInfo, &style_list, LV_STATE_DEFAULT);
	lv_obj_set_style_border_opa(list_extantInfo, LV_OPA_TRANSP, LV_STATE_DEFAULT);

	/* 在历史信息页面创建历史信息表头 */
	lv_obj_t * cont_tileHistory;/* 历史信息表头容器 */
	cont_tileHistory = lv_obj_create(tile_historyInfo);/* 在历史信息页面中创建历史信息表头容器 */
	lv_obj_set_size(cont_tileHistory, lv_pct(100), lv_pct(15));/* 设置历史信息表头容器的大小、位置、颜色、内部边距 */
	lv_obj_align(cont_tileHistory, LV_ALIGN_TOP_MID, 0, 0);
//	lv_obj_set_style_bg_color(cont_tileHistory, lv_color_hex(0xffffff), 0);
	lv_obj_set_style_radius(cont_tileHistory, 0, LV_STATE_DEFAULT);/* 圆角 */
	lv_obj_set_style_pad_top(cont_tileHistory, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(cont_tileHistory, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(cont_tileHistory, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(cont_tileHistory, 1, LV_STATE_DEFAULT);
	lv_obj_set_style_border_opa(cont_tileHistory, LV_OPA_TRANSP, LV_STATE_DEFAULT);

	lv_obj_t * label_tile2_ID = lv_label_create(cont_tileHistory);/* 列表中增加"编号"标签 */
	lv_label_set_text(label_tile2_ID, dispText[DA.typeLanguage].infoTttle_ID);
	lv_obj_set_size(label_tile2_ID, lv_pct(11), lv_pct(100));
	lv_obj_add_style(label_tile2_ID, &style_label_tile, LV_STATE_DEFAULT);

	lv_obj_t * label_tile2_time = lv_label_create(cont_tileHistory);/* 列表中增加"产生时间"标签 */
	lv_label_set_text(label_tile2_time, dispText[DA.typeLanguage].infoTttle_ariseTime);
	lv_obj_set_size(label_tile2_time, lv_pct(29), lv_pct(100));
	lv_obj_add_style(label_tile2_time, &style_label_tile, LV_STATE_DEFAULT);
	lv_obj_align_to(label_tile2_time, label_tile2_ID, LV_ALIGN_OUT_RIGHT_MID, 0, 0);

	lv_obj_t * label_tile2_duration = lv_label_create(cont_tileHistory);/* 列表中增加"持续时间"标签 */
	lv_label_set_text(label_tile2_duration, dispText[DA.typeLanguage].infoTttle_duration);
	lv_label_set_long_mode(label_tile2_duration, LV_LABEL_LONG_SCROLL_CIRCULAR);
	lv_obj_set_size(label_tile2_duration, lv_pct(11), lv_pct(100));
	lv_obj_add_style(label_tile2_duration, &style_label_tile, LV_STATE_DEFAULT);
	lv_obj_align_to(label_tile2_duration, label_tile2_time, LV_ALIGN_OUT_RIGHT_MID, 0, 0);

	lv_obj_t * label_tile2_text = lv_label_create(cont_tileHistory);/* 列表中增加"文本"标签 */
	lv_label_set_text(label_tile2_text, dispText[DA.typeLanguage].infoTttle_historyText);
	lv_obj_set_size(label_tile2_text, lv_pct(49), lv_pct(100));
	lv_obj_add_style(label_tile2_text, &style_label_tile, LV_STATE_DEFAULT);
	lv_obj_align_to(label_tile2_text, label_tile2_duration, LV_ALIGN_OUT_RIGHT_MID, 0, 0);

//	lv_obj_t * label_tile2_type = lv_label_create(cont_tileHistory);/* 列表中增加"类型"标签 */
//	lv_label_set_text(label_tile2_type, dispText[DA.typeLanguage].infoTttle_type);
//	lv_obj_set_size(label_tile2_type, lv_pct(15), lv_pct(100));
//	lv_obj_add_style(label_tile2_type, &style_label_tile, LV_STATE_DEFAULT);
//	lv_obj_align_to(label_tile2_type, label_tile2_duration, LV_ALIGN_OUT_RIGHT_MID, 0, 0);

	/* 在历史信息页面创建历史信息列表 */
	list_historyInfo = lv_list_create(tile_historyInfo);
	lv_obj_set_size(list_historyInfo, lv_pct(100), lv_pct(85));
	lv_obj_align_to(list_historyInfo, cont_tileHistory, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
	lv_obj_add_style(list_historyInfo, &style_list, LV_STATE_DEFAULT);
	lv_obj_set_style_border_opa(list_historyInfo, LV_OPA_TRANSP, LV_STATE_DEFAULT);

//	btn_toggleInfo = lv_btn_create(cont_info);/* 在按键容器中创建切换信息按键 */
//	/* 设置按键的大小、位置、颜色、外轮廓宽度 */
//	lv_obj_set_size(btn_toggleInfo, lv_pct(25), lv_pct(15));
//	lv_obj_align(btn_toggleInfo, LV_ALIGN_TOP_LEFT, 0, 0);
//	lv_obj_set_style_bg_color(btn_toggleInfo, lv_color_hex(0x003a8c), 0);
//	lv_obj_set_style_outline_width(btn_toggleInfo, 0, LV_STATE_DEFAULT);
//	lv_obj_set_style_shadow_width(btn_toggleInfo, 0, LV_STATE_DEFAULT);
//	label_toggleInfo = lv_label_create(btn_toggleInfo);/* 在切换信息按键中创建切换信息标签 */
//	/* 设置标签的内容、位置 */
//	lv_label_set_text(label_toggleInfo, dispText[DA.typeLanguage].extantInfo);
//	lv_obj_set_align(label_toggleInfo,LV_ALIGN_CENTER);
//	lv_obj_add_event_cb(btn_toggleInfo, btn_toggleInfo_cb, LV_EVENT_CLICKED, NULL);   /*分配一个事件回调*/

	btn_extantInfo = lv_btn_create(cont_info);/* 在按键容器中创建切换信息按键 */
	/* 设置按键的大小、位置、颜色、外轮廓宽度 */
	lv_obj_set_size(btn_extantInfo, 126, 34);
	lv_obj_align(btn_extantInfo, LV_ALIGN_TOP_LEFT, 0, lv_pct(5));
	lv_obj_set_style_bg_color(btn_extantInfo, lv_color_hex(0x9c9c9c), 0);
	lv_obj_set_style_bg_img_src(btn_extantInfo, &dsc_ico_buff[6], LV_STATE_DEFAULT);
	lv_obj_set_style_bg_img_src(btn_extantInfo, &dsc_ico_buff[5], LV_STATE_CHECKED);
//	lv_obj_set_style_outline_width(btn_extantInfo, 0, LV_STATE_DEFAULT);
//	lv_obj_set_style_shadow_width(btn_extantInfo, 0, LV_STATE_DEFAULT);
	lv_obj_t * label = lv_label_create(btn_extantInfo);/* 在切换信息按键中创建切换信息标签 */
	/* 设置标签的内容、位置 */
	lv_label_set_text(label, dispText[DA.typeLanguage].historyInfo);
	lv_obj_set_align(label,LV_ALIGN_CENTER);
	lv_obj_add_state(btn_extantInfo, LV_STATE_CHECKED);
	lv_obj_add_event_cb(btn_extantInfo, btn_toggleInfo_cb, LV_EVENT_CLICKED, NULL);   /*分配一个事件回调*/

	btn_historyInfo = lv_btn_create(cont_info);/* 在按键容器中创建切换信息按键 */
	/* 设置按键的大小、位置、颜色、外轮廓宽度 */
	lv_obj_set_size(btn_historyInfo, 126, 34);
	lv_obj_align(btn_historyInfo, LV_ALIGN_TOP_LEFT, lv_pct(23), lv_pct(5));
	lv_obj_set_style_bg_color(btn_historyInfo, lv_color_hex(0x9c9c9c), 0);
	lv_obj_set_style_bg_img_src(btn_historyInfo, &dsc_ico_buff[6], LV_STATE_DEFAULT);
	lv_obj_set_style_bg_img_src(btn_historyInfo, &dsc_ico_buff[5], LV_STATE_CHECKED);
//	lv_obj_set_style_outline_width(btn_historyInfo, 0, LV_STATE_DEFAULT);
//	lv_obj_set_style_shadow_width(btn_historyInfo, 0, LV_STATE_DEFAULT);
	label = lv_label_create(btn_historyInfo);/* 在切换信息按键中创建切换信息标签 */
	/* 设置标签的内容、位置 */
	lv_label_set_text(label, dispText[DA.typeLanguage].extantInfo);
	lv_obj_set_align(label,LV_ALIGN_CENTER);
	lv_obj_add_event_cb(btn_historyInfo, btn_toggleInfo_cb, LV_EVENT_CLICKED, NULL);   /*分配一个事件回调*/

}
/* 创建按键容器并进行配置 */
static void createCont_btn(void)
{
	cont_btn = lv_obj_create(lv_scr_act());/* 在活动界面中创建按键容器 */
	/* 设置按键容器的大小、位置、颜色 */
	lv_obj_set_size(cont_btn, lv_pct(27), lv_pct(78));
	lv_obj_align(cont_btn, LV_ALIGN_TOP_LEFT, 0, lv_pct(18));
	lv_obj_set_style_bg_color(cont_btn, lv_color_hex(0xffffff), 0);
	lv_obj_set_style_pad_top(cont_btn, 0, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(cont_btn, 2, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(cont_btn, 2, LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(cont_btn, 2, LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(cont_btn, LV_OPA_TRANSP, LV_STATE_DEFAULT);
	lv_obj_set_style_border_opa(cont_btn, LV_OPA_TRANSP, LV_STATE_DEFAULT);
	lv_obj_t * btn_soundOnOff;/* 声音开关按键 */
	btn_soundOnOff = lv_btn_create(cont_btn);/* 在按键容器中创建声音开关按键 */
	/* 设置按键的大小、位置、颜色、外轮廓宽度 */
	lv_obj_set_size(btn_soundOnOff, 202, 89);
	lv_obj_align(btn_soundOnOff, LV_ALIGN_TOP_LEFT, 0, lv_pct(13));
	lv_obj_add_flag(btn_soundOnOff, LV_OBJ_FLAG_CHECKABLE);
	if(soundState)
	{
		lv_obj_add_state(btn_soundOnOff, LV_STATE_CHECKED);
		lv_obj_add_flag(btn_soundOnOff, LV_OBJ_FLAG_USER_1);
	}
    lv_obj_set_style_bg_color(btn_soundOnOff, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
	lv_obj_set_style_bg_img_src(btn_soundOnOff, &dsc_ico_buff[3], LV_STATE_DEFAULT);
	lv_obj_set_style_bg_img_src(btn_soundOnOff, &dsc_ico_buff[2], LV_STATE_CHECKED);
	lv_obj_set_style_outline_width(btn_soundOnOff, 0, LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(btn_soundOnOff, 0, LV_STATE_DEFAULT);
	label_soundOnOff = lv_label_create(btn_soundOnOff);/* 在静音按键中创建静音标签 */
	/* 设置标签的内容、位置 */
	lv_label_set_text(label_soundOnOff, dispText[DA.typeLanguage].soundOff);
	lv_obj_set_style_text_color(label_soundOnOff, lv_color_hex(0x000000), LV_STATE_DEFAULT);
	lv_obj_set_align(label_soundOnOff,LV_ALIGN_CENTER);
	lv_obj_add_event_cb(btn_soundOnOff, btn_soundOnOff_cb, LV_EVENT_CLICKED, NULL);   /*分配一个事件回调*/

//	btn_toggleInfo = lv_btn_create(cont_btn);/* 在按键容器中创建切换信息按键 */
//	/* 设置按键的大小、位置、颜色、外轮廓宽度 */
//	lv_obj_set_size(btn_toggleInfo, lv_pct(100), lv_pct(20));
//	lv_obj_align(btn_toggleInfo, LV_ALIGN_TOP_LEFT, 0, lv_pct(28));
//	lv_obj_set_style_bg_color(btn_toggleInfo, lv_color_hex(0x003a8c), 0);
//	lv_obj_set_style_outline_width(btn_toggleInfo, 0, LV_STATE_DEFAULT);
//	lv_obj_set_style_shadow_width(btn_toggleInfo, 0, LV_STATE_DEFAULT);
//	label_toggleInfo = lv_label_create(btn_toggleInfo);/* 在切换信息按键中创建切换信息标签 */
//	/* 设置标签的内容、位置 */
//	lv_label_set_text(label_toggleInfo, dispText[DA.typeLanguage].extantInfo);
//	lv_obj_set_align(label_toggleInfo,LV_ALIGN_CENTER);
//	lv_obj_add_event_cb(btn_toggleInfo, btn_toggleInfo_cb, LV_EVENT_CLICKED, NULL);   /*分配一个事件回调*/
//
	lv_obj_t * btn_resetInfo;/* 复位信息按键 */
	btn_resetInfo = lv_btn_create(cont_btn);/* 在按键容器中创建复位信息按键 */
	/* 设置按键的大小、位置、颜色、外轮廓宽度 */
	lv_obj_set_size(btn_resetInfo, 202, 89);
	lv_obj_align(btn_resetInfo, LV_ALIGN_TOP_LEFT, 0, lv_pct(38));
    lv_obj_set_style_bg_color(btn_resetInfo, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
	lv_obj_set_style_bg_img_src(btn_resetInfo, &dsc_ico_buff[3], LV_STATE_DEFAULT);
	lv_obj_set_style_bg_img_src(btn_resetInfo, &dsc_ico_buff[2], LV_STATE_CHECKED);
	lv_obj_set_style_outline_width(btn_resetInfo, 0, LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(btn_resetInfo, 0, LV_STATE_DEFAULT);
	lv_obj_t * label_resetInfo = lv_label_create(btn_resetInfo);/* 在切换信息按键中创建切换信息标签 */
	/* 设置标签的内容、位置 */
	lv_label_set_text(label_resetInfo, dispText[DA.typeLanguage].resetInfo);
	lv_obj_set_align(label_resetInfo,LV_ALIGN_CENTER);
	lv_obj_set_style_text_color(label_resetInfo, lv_color_hex(0x000000), LV_STATE_DEFAULT);
	lv_obj_add_event_cb(btn_resetInfo, btn_resetInfo_cb, LV_EVENT_CLICKED, NULL);   /*分配一个事件回调*/

	lv_obj_t * btn_moreInfo;/* 更多信息按键 */
	btn_moreInfo = lv_btn_create(cont_btn);/* 在按键容器中创建更多信息按键 */
	/* 设置按键的大小、位置、颜色、外轮廓宽度 */
	lv_obj_set_size(btn_moreInfo, 202, 89);
	lv_obj_align(btn_moreInfo,LV_ALIGN_TOP_LEFT, 0, lv_pct(63));
	lv_obj_set_style_bg_img_src(btn_moreInfo, &dsc_ico_buff[3], LV_STATE_DEFAULT);
	lv_obj_set_style_outline_width(btn_moreInfo, 0, LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(btn_moreInfo, 0, LV_STATE_DEFAULT);
	lv_obj_t * label_moreInfo = lv_label_create(btn_moreInfo);/* 在切换信息按键中创建切换信息标签 */
	/* 设置标签的内容、位置 */
	lv_label_set_text(label_moreInfo, dispText[DA.typeLanguage].moreInfo);
	lv_obj_set_align(label_moreInfo,LV_ALIGN_CENTER);
	lv_obj_set_style_text_color(label_moreInfo, lv_color_hex(0x000000), LV_STATE_DEFAULT);
	lv_obj_add_event_cb(btn_moreInfo, btn_moreInfo_cb, LV_EVENT_CLICKED, NULL);   /*分配一个事件回调*/
}
/* 初始化信息界面的公用风格,【注意】此函数在启动时调用一次即可 */
void UI_initStyle_info(void)
{
	/* 表头标签的样式 */
	lv_style_init(&style_label_tile);
	lv_style_set_pad_top(&style_label_tile, 1);/* 顶部内填充 */
	lv_style_set_text_align(&style_label_tile, LV_TEXT_ALIGN_CENTER);/* 文本居中 */
	lv_style_set_radius(&style_label_tile, 0);/* 圆角 */
	lv_style_set_border_color(&style_label_tile, lv_palette_main(LV_PALETTE_GREY));
	lv_style_set_border_opa(&style_label_tile, LV_OPA_100);
	lv_style_set_border_width(&style_label_tile, 1);
	lv_style_set_border_side(&style_label_tile, LV_BORDER_SIDE_RIGHT);
	/* 列表容器的样式 */
	lv_style_init(&style_list);
	lv_style_set_radius(&style_list, 0);/* 圆角 */
	lv_style_set_pad_left(&style_list, 0);/* 左边内测填充 */
	lv_style_set_pad_right(&style_list, 0);/* 右边内测填充 */

}
/* 刷新信息列表 */
void UI_refresh_infoList(void)
{
	static uint32_t cnt_time = 0; /* 计时，每秒加1 */
	static uint16_t old_infoGroup[INFO_GROUP_QTY] = {0};
	infoGroup[0] = &UP.regAddr101.rState_Alarm1;
	infoGroup[1] = &UP.regAddr102.rState_Alarm2;
	infoGroup[2] = &UP.regAddr103.rState_Alarm3;
	infoGroup[3] = &UP.regAddr104.rState_Alarm4;
	infoGroup[4] = &UP.regAddr140.rState_Alarm5;
	infoGroup[5] = &UP.regAddr141.rState_Alarm6;

	cnt_time++;	/* 计时，每秒加1 */
	/* 判断与之前信息组是否不同 */
	for(uint8_t i = 0; i < INFO_GROUP_QTY; i++)
	{
		if(old_infoGroup[i] != *infoGroup[i])
		{
			for(uint8_t j = 0; j < 16; j++)
			{
				uint16_t bit = 0x0001;
				if((old_infoGroup[i] & (bit << j)) != (*infoGroup[i] & (bit << j)))/* 找到信息组不同的那一位 */
				{
					if(*infoGroup[i] & (bit << j))/* 如果这一位新的状态为1 */
					{
						nodeLib[i * 16 + j].ariseTime = DS.clockTime;
						nodeLib[i * 16 + j].ariseCnt = cnt_time;
						nodeLib[i * 16 + j].duration = 0;
						list_addHeadNode(&listNode_extantInfo, nodeLib[i * 16 + j]);
						list_addHeadNode(&listNode_historyInfo, nodeLib[i * 16 + j]);
						if(++historyInfoNodeQty > HISTORY_INFO_DISP_QTY_MAX)/* 如果历史信息节点数量大于最大值 */
						{
							list_delTailNode(&listNode_historyInfo);/* 从历史信息列表尾部删除一个节点 */
							historyInfoNodeQty--;
						}
						old_infoGroup[i] |= (bit << j);
					}
					else/* 如果这一位新的状态为0 */
					{
						nodeLib[i * 16 + j].duration = cnt_time - nodeLib[i * 16 + j].ariseCnt;
						list_editNodeByID(&listNode_historyInfo, nodeLib[i * 16 + j].id, nodeLib[i * 16 + j]);/* 修改历史节点 */
						list_delMiddNode(&listNode_extantInfo, nodeLib[i * 16 + j].id);
						old_infoGroup[i] &= ~(bit << j);
					}
					refresh_infoScreen_flag = 1;
	                if (g_RW_State == RW_READY)
	                {
	                    g_RW_State = RW_WRITE_NAND_ALARM;
	                }
				}
			}
		}
	}
}
static void bg_create(void)   // 创建背景图片
{
	parentObj_img = lv_img_create(lv_scr_act());
    lv_img_set_src(parentObj_img, &dsc_img_buff[2]);
    lv_obj_add_style(parentObj_img, &style_parentObj, LV_STATE_DEFAULT);  //添加父对象为无填充样式
    lv_obj_set_size(parentObj_img, lv_pct(100), lv_pct(100));  //设置父对象的大小
    lv_obj_align(parentObj_img, LV_ALIGN_BOTTOM_MID, 0, 0);  //设置父对象的位置
}
/* 创建信息界面 */
void UI_create_info(void)
{
//	UI_initStyle_info();		/* 初始化信息界面的公用风格,【注意】此函数在启动时调用一次即可 */
	bg_create();			/* 创建背景图片 */
	createCont_info();		/* 创建信息容器并进行配置 */
	createCont_btn();		/* 创建按键容器并进行配置 */
//	lv_timer_create(UI_refresh_infoList, 1000, NULL);	/* 创建定时器用于刷新处理信息列表,【注意】此定时器在系统运行时开启 */
	timer_refresh_infoScreen = lv_timer_create(refresh_infoScreen, 200, NULL);	/* 创建定时器用于刷新信息内容,此定时器在进入信息界面时开启 */
	refresh_infoScreen_flag = 1;  /* 刷新历史报警记录 */
}
/* 删除信息界面 */
void UI_delete_info(void)
{
	lv_obj_del(parentObj_img);	/* 删除信息容器 */
	lv_obj_del(cont_info);	/* 删除信息容器 */
	lv_obj_del(cont_btn);	/* 删除按键容器 */
	lv_timer_del(timer_refresh_infoScreen);	/* 删除信息容器 */
	moreExtantInfo_id = 0;	/* 清除选择的实时信息 */
	moreHistoryInfo_id = 0;	/* 清除选择的历史信息 */
	refresh_infoScreen_flag = 1;	/* 刷新历史报警记录 */
}
/**************** (C) COPYRIGHT EdwardYang *************END OF FILE****/


